﻿using Abp.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Ny.CenterServers.Test;

namespace Ny.CenterServers.EntityFrameworkCore
{
    public class CenterServersDbContext : AbpDbContext
    {
        //Add DbSet properties for your entities...

        public CenterServersDbContext(DbContextOptions<CenterServersDbContext> options) 
            : base(options)
        {

        }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            //移除复数表达
            foreach (var entityType in modelBuilder.Model.GetEntityTypes())
            {
                // Skip shadow types
                if (entityType.ClrType == null)
                    continue;

                entityType.Relational().TableName = entityType.ClrType.Name;
            }
            base.OnModelCreating(modelBuilder);
        }
        public DbSet<TestModel> TestModels { get; set; }
        
        
    }
}
